<?php
declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class CreateUrgeMessageTable extends AbstractMigration
{
    public function up()
    {
        $table = $this->table('urge_message', ['id' => false, 'primary_key' => ['id'], 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '催一催记录表']);
        $table->addColumn('id', 'integer', ['identity' => true, 'signed' => false, 'limit' => 11, 'comment' => '催一催记录id'])
            ->addColumn('type', 'enum', ['default' => 'app', 'values' => "app,sms", 'comment' => '类型(app 应用,sms 短信)'])
            ->addColumn('content', 'json', ['null' => true, 'comment' => '内容参数'])
            ->addColumn('created', 'integer', ['signed' => false, 'default' => 0, 'limit' => 11, 'comment' => '创建时间'])
            ->save();
    }

    public function down()
    {
        $this->table('urge_message')->drop()->save();
    }
}
